package com.repository;

import com.entity.Article;
import com.entity.Topic;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.query.Param;

import java.util.List;

public interface TopicRepository extends JpaRepository<Topic,Integer>, JpaSpecificationExecutor<Article> {

    List<Topic> findByIsRecommend(@Param("isRecommend") Integer isRecommend);

    Page<Topic> findAllByNameLike(String name, Pageable page);

    long countByNameLike(String name);


}
